package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysStu;
import com.ruoyi.system.service.ISysStuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;


@RestController
@RequestMapping("/system/student")
public class SysStuController extends BaseController{


    @Autowired
    private ISysStuService sysStuService;


    /**
     * 、测试接口
     * @return
     */
    @PreAuthorize("@ss.hasPermi('system:student:test')")
    @Log(title = "学生管理", businessType = BusinessType.OTHER)
    @GetMapping("/test")
    public AjaxResult Test(){
        SysStu sysStu = sysStuService.selectSysStuById(8848);
        return success(sysStu);
    }

    /**
     * 获取所有学生信息
     * @return
     */
    @PreAuthorize("@ss.hasPermi('system:student:list')")
    @Log(title = "学生管理", businessType = BusinessType.GETDATA)
    @GetMapping("/list")
    public TableDataInfo getAllStudent(){
        startPage();
        return getDataTable(sysStuService.selectAllStudent());
    }


}
